package com.shine.app.ui;

import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.shine.app.AppManager;
import com.shine.app.BaseActivity;
import com.shine.app.R;
import com.shine.app.commons.UIHelper;
import com.shine.app.inject.InjectView;
import com.shine.app.inject.Injector;

public class ViewMyInfo_ReviewWriteDialogActivity extends BaseActivity
		implements OnClickListener {

	@InjectView(R.id.submit)
	private TextView submiTextView;
	@InjectView(R.id.cancel)
	private TextView cancelTextView;
	@InjectView(R.id.message)
	private TextView messageTextView;
	@InjectView(R.id.layout)
	private LinearLayout layout;
	@InjectView(R.id.progressBar)
	private ProgressBar progressBar;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.setContentView(R.layout.dialog_cancelteetimes);
		Injector.get(this).inject();
		init();
	}

	private void init() {
		progressBar.setVisibility(View.GONE);
		cancelTextView.setText(R.string.cancel);
		submiTextView.setText(R.string.login);
		messageTextView.setText(R.string.msg_must_login_to_review);
		submiTextView.setOnClickListener(this);
		cancelTextView.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.cancel:
			break;
		case R.id.submit:
			UIHelper.showLogin(this);
			overridePendingTransition(R.anim.slide_in_up, R.anim.anim);
			break;

		default:
			break;
		}
		AppManager.getAppManager().finishActivity();
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			AppManager.getAppManager().finishActivity();
		}
		return true;
	}
}
